<?php
namespace app\v1\validate;

use think\Validate;

class User extends Validate
{
    protected $rule = [
        'uid'  =>  'require',
        'token' =>  'checktoken'
    ];

     protected $message  =   [
        'uid.require' => 'uid缺失',
        'token.checktoken' => '令牌错误！',
    ];

    public function checktoken($value)
    {
    	if(cache('token')==$value){
    		return true;
    	}else{
    		return false;
    	}
    }
}